<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
	<title>游币用户详情</title>
    
    <meta charset="utf-8"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" href="gold/css/bootstrap.min.css">
	<link rel="stylesheet" href="gold/css/index.css" />
	<script src="gold/js/jquery.js"></script>
	<script src="gold/js/bootstrap.min.js"></script>

  </head>
  
  <body onload="getNowTime()">
    <div class="container">
		<nav class="navbar navbar-default" >
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target="#example-navbar-collapse">
					<span class="sr-only">切换导航</span> <span class="icon-bar"></span> <span
						class="icon-bar"></span> <span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="gold/user/portal.jsp">游币手机下载门户网站</a>
			</div>
			<div class="collapse navbar-collapse" id="example-navbar-collapse">
				<ul class="nav navbar-nav">
					<li class="dropdown"><a href="gold/user/portal.jsp" id="time"></a></li>
				</ul>
				<ul class="nav navbar-nav navbar-right">
				
					<c:if test="${userLogin!=null}">
						<li class="dropdown"><a href="gold/user/portal.jsp">欢迎${userLogin.userName}</a></li>
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown">个人中心<b class="caret"></b> </a>
							<ul class="dropdown-menu">
								<li><a data-toggle="modal"
									data-target="#myModal">密保卡充值</a></li>
								<li><a href="toPrepaidJsp.do">充值记录</a></li>
								<li><a href="toUserDetailJsp.do">账户信息</a></li>
								<li><a href="toExpenseJsp.do">消费记录</a></li>
								<li class="divider"></li>
								<li><a id="exit" onclick="exitSystem()">退出</a></li>
							</ul>
						</li>
					</c:if>
					
					<c:if test="${userLogin==null}">
						<script type="text/javascript">
							location.href = "gold/user/login.jsp";
						</script>
					</c:if>
					
				</ul>
			</div>
		</nav>
	</div>
	
	<div class="modal fade" id="myModal" tabindex="-1" >
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">密保卡充值</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" action="addCardAmount.do" 
					enctype="multipart/form-data" method="post">
						<div class="form-group">
							<label for="firstname" class="col-sm-2 control-label">卡号</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="cardNumber"
									name="cardNumber" placeholder="请输入卡号">
							</div>
						</div>
						<div class="form-group">
							<label for="lastname" class="col-sm-2 control-label">密码</label>
							<div class="col-sm-10">
									<input type="text" class="form-control" id="cardPwd"
									placeholder="请输入卡密码" name="cardPwd" />
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<button type="submit" class="btn btn-default">确认充值</button>
							</div>
						</div>
						<input type="hidden" name="userIdString" value="${userLogin.userId}"/>
					</form>
				</div>

			</div>
		</div>
	</div>
				
				
	<div class="row" style="background-color:#CCC; 
	overflow:hidden;" onLoad="init()">
		<div class="col-md-12">
			<ul class="nav nav-pills col-md-offset-3" >
				<li class=><a href="gold/user/portal.jsp" class="btn btn-primary">首页</a></li>
		  		
		  		<c:forEach items="${gameTypePortalList}" var="gameType">
						<li><a href="toGameTypeJsp.do?gameType=${gameType.typeId}" class="btn btn-primary">${gameType.typeName}</a></li>
				</c:forEach>
		  		
	      		<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
	      		<li>
					<select class="form-control" name="gameTypeId">
						<option value="0">默认</option>
						<c:forEach items="${gameTypeList}" var="gameType">
								<option value="${gameType.typeId}">${gameType.typeName}</option>
						</c:forEach>
					</select>
				</li>
				<li><input type="text" class="form-control" name="searchGame"/></li>
				<li><a id="search" class="btn btn-primary" onclick="searchGame()">查询</a></li>
				
    		</ul>
		</div>
    </div>
   
	<div class="row">&nbsp;</div>
	<div class="container">
		<div class="row">
			<div class="col-md-6">
				<div class="table-responsive">
					<table class="table table-striped table-hover">
						<caption>账户详情</caption>
						<tbody>
							<tr>
								<td><strong>用户名:</strong>${user.userName}</td>
							</tr>
							<tr>
								<td><strong>密码:</strong>${user.userPwd}</td>
							</tr>
							<tr>
								<td><strong>性别:</strong>${user.userSex}</td>
							</tr>
							<tr>
								<td><strong>生日:</strong>
								${userLogin.userBirthday}
								</td>
							</tr>
							<tr>
								<td>
									<strong>手机号码:</strong>${user.userPhone}
									&nbsp;<strong>手机号码区域:</strong>${mobile.mobileArea}
									&nbsp;<strong>手机号码类型:</strong>${mobile.mobileType}
								</td>
							</tr>
							<tr>
								<td><strong>话费余额:</strong>${user.userTariffe}</td>
							</tr>
							<tr>
								<td><strong>游币余额:</strong>${user.userCurrency}</td>
							</tr>
							<tr>
								<td><strong>密保额度:</strong>${user.userCardAmount}</td>
							</tr>
							
						</tbody>
					</table>
					
       				<a class="btn btn-warning" onclick="goBack()">返回上页</a>
       				<a class="btn btn-primary" href="gold/user/forgetPwd.jsp">修改密码</a>
				</div>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="container">
			<hr/>
			<div class="col-md-4 col-md-offset-5">
			&copy;2016-2017 portal.com 版权所有
			</div>
		</div>	
	</div>
	
	<script type="text/javascript">
		function exitSystem(){
			var v1 = confirm("确认退出吗？");
			if(v1){
				//location.href="exitUserSystem.do";
				$("#exit").attr("href","exitUserSystem.do");
			}
		}
		
  		function getNowTime(){
  			var date = new Date();
	  		$("#time").text(date.toLocaleDateString()+"-"+date.toLocaleTimeString());
	  		setTimeout(getNowTime,1000);
	  	}
  		
  		function searchGame(){
  			var v1 = $("select[name='gameTypeId']").val();
  			var v2 = $("input[name='searchGame']").val();
  			var v3 = "searchGame.do?gameName="+v2+"&gameType="+v1;
  			$("#search").attr("href",v3);
  			//location.href = "searchGame.do?gameName="v2+"&gameType="v1;
  		}
  		
	</script>
	
  <script type="text/javascript">
  	function goBack(){
  		window.history.back();
  	}
  </script>	
	
  </body>
  	
</html>
